package com.fanhang.samples.spring.security.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping(value = "/admin")
public class AdminController {

	@RequestMapping(value = "/", method = { RequestMethod.GET })
	public void index(Model model) {
		model.addAttribute("message", "This is admin/");
	}
	
	@RequestMapping(value = "/add", method = { RequestMethod.GET })
	public String add(HttpServletRequest request, Model model) {
		return "form/form-sample";
	}
	
	@RequestMapping(value = "/show", method = { RequestMethod.POST })
	public String show() {
		return "form/form-sample";
	}

}
